#include <stdio.h> 
int main()
{
	freopen("test.in", "r", stdin);
	freopen("test.out", "w", stdout);
	for ( int i = 100; i <= 999; i++ ) {
		int data = i;
		int sum = 0;
		for ( int j = 0; j < 3; j++ ) {
			int d = data % 10;
			sum += d * d * d;	
			data /= 10;
		}
		if ( sum == i ) {
			printf("%d\n", i);
		}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
